 #@layout()
 #define content()

<span class="layui-breadcrumb">
  <a href="/">首页</a>
  <a href="/admin/myWebsitePublish"><cite>发布内容</cite></a>
</span>

<hr>
<br/>

<div class="layui-fluid">
	<div class="layui-row">
		<div class="layui-col-sm1">
			&nbsp;
		</div>
		<div class="layui-col-sm9">
			<div class="layui-form">
				<!-- 提示：如果你不想用form，你可以换成div等任何一个普通元素 -->
			
				<div class="layui-form-item">
					<div class="layui-inline" id="treeSelect" >
						<label class="layui-form-label">请选择栏目</label>
					</div>
				</div>
				
				<div class="layui-form-item">
					<div class="layui-inline" id="" >
						<label class="layui-form-label">&nbsp;</label>
						<button class="layui-btn layui-btn-radius layui-btn-normal" id="nextTip">下一步</button>
					</div>
				</div>
			
			</div>
			
			<hr>
			
		</div>
	</div>
</div>


#end

#define js()

<script>

function initTree(){
	$("#treeElem").html("");
	$.ajax({
		type:'get',
		url:'/admin/myWebsiteColumn/tree',
		data:'',
		success:function(data){
			if(data.code=='0'){
				nodes=data.data;
				
				layui.use('treeSelect',function(){
					var treeSelect=layui.treeSelect;
					treeSelect.init("#treeSelect",{
						nodes:nodes,
						data:""
					});
				});
			}
		}
	});
}

function nextTip(){
	var data=layui.treeSelect.getData("#treeSelect");
	if(data[data.length-1]==""){
		alert("请选择具体的栏目");
		return;
	}
	window.location.href="/admin/myWebsite/publish?websiteColumnId="+data[data.length-1];
}

$(function(){
	$("#nextTip").click(function(){
		nextTip();
	});
});


initTree();

</script>

#end


